<!DOCTYPE html>
<html lang="zh-cn" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>修改题目</title>
    <link rel="shortcut icon" href="../../static/img/icon.svg">
    <meta charset="utf-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no"/>
    <link rel="stylesheet" href="../../static/html5up-forty/assets/css/main.css"/>
    <noscript>
        <link rel="stylesheet" href="../../static/html5up-forty/assets/css/noscript.css"/>
    </noscript>

</head>
<body class="is-preload">
<div id="wrapper">
    <!-- Header -->
    <header id="header" class="alt">
        <a th:href="@{|/manage|}" class="logo"><strong>Jli</strong> <span>by my</span></a>
        <nav>
            <p style="font-size: 15px" th:text="${session.teacher.getName()} + 老师"></p>
            <a href="#menu">菜单</a>
        </nav>
    </header>

    <!-- Menu -->
    <nav id="menu">
        <ul class="links">
            <li><a th:href="@{|/manage|}">主页</a></li>
            <li><a href="#">编辑信息</a></li>
            <li><a href="#">修改密码</a></li>
        </ul>
        <ul class="actions stacked">
            <li><a th:href="@{|/teacherLogout|}" class="button fit">退出登录</a></li>
        </ul>
    </nav>

    <!-- Banner -->
    <section id="banner" class="major">
        <div class="inner">
            <header class="major">
                <h1>Jli-修改题目</h1>
            </header>
            <div class="content">
                <ul class="actions">
                    <li><a th:href="@{|/toManageExercise|}" class="button next scrolly">返回习题列表</a></li>
                </ul>
            </div>
        </div>
    </section>


    <!-- Main -->
    <div id="main">

        <!-- One -->

        <section id="one" class="inner">
            <form>
                <h5>题目修改</h5>
                <input type="hidden" th:value="${exercise.getId()}" id="eid">
                <div class="gtr-uniform row">
                    <div class="col-6-xsmall col-12">
                        <label for="title">
                            题目：
                            <textarea rows="6" name="title" id="title" placeholder="请输入题目" th:text="${exercise.getTitle()}"></textarea>
                        </label>
                    </div>
                </div>
                <br>
                <div class="gtr-uniform row">
                    <div class="col-6-xsmall col-3">
                        <label for="optionA">
                            答案A：
                            <textarea rows="2" name="optionA" id="optionA" placeholder="输入选项A" th:text="${option.getOptionA()}"></textarea>
                        </label>
                    </div>
                    <div class="col-6-xsmall col-3">
                        <label for="optionB">
                            答案B：
                            <textarea rows="2" name="optionB" id="optionB" placeholder="输入选项B" th:text="${option.getOptionB()}"></textarea>
                        </label>
                    </div>
                    <div class="col-6-xsmall col-3">
                        <label for="optionC">
                            答案C：
                            <textarea rows="2" name="optionC" id="optionC" placeholder="输入选项C" th:text="${option.getOptionC()}"></textarea>
                        </label>
                    </div>
                    <div class="col-6-xsmall col-3">
                        <label for="optionD">
                            答案D：
                            <textarea rows="2" name="optionD" id="optionD" placeholder="输入选项D" th:text="${option.getOptionD()}"></textarea>
                        </label>
                    </div>
                </div>
                <br>
                <div class="gtr-uniform row">
                    <div class="col-6-xsmall col-4">
                        <label>
                            类型：
                            <select name="type" class="small" id="type">
                                <option th:each="type:${typeList}" th:value="${type.id}" th:text="${type.name}" th:if="${type.id == exercise.type}" selected></option>
                                <option th:each="type:${typeList}" th:value="${type.id}" th:text="${type.name}" th:if="${type.id != exercise.type}"></option>
                            </select>
                        </label>
                    </div>
                    <div class="col-6-xsmall col-4">
                        <label>
                            所属章节：
                            <select name="chapter" class="small" id="chapter">
                                <option th:each="chapter:${chapterList}" th:value="${chapter.id}" th:text="${chapter.name}" th:if="${chapter.id == exercise.chapter}" selected></option>
                                <option th:each="chapter:${chapterList}" th:value="${chapter.id}" th:text="${chapter.name}" th:if="${chapter.id != exercise.chapter}"></option>
                            </select>
                        </label>
                    </div>
                    <div class="col-6-xsmall col-4">
                        <label>
                            正确答案：
                            <select name="answer" class="small" id="answer">
                                <option value="A" th:if="${exercise.answer.equals('A')}" selected>A</option>
                                <option value="A" th:if="${!exercise.answer.equals('A')}">A</option>
                                <option value="A" th:if="${exercise.answer.equals('B')}" selected>B</option>
                                <option value="A" th:if="${!exercise.answer.equals('B')}">B</option>
                                <option value="A" th:if="${exercise.answer.equals('C')}" selected>C</option>
                                <option value="A" th:if="${!exercise.answer.equals('C')}">C</option>
                                <option value="A" th:if="${exercise.answer.equals('D')}" selected>D</option>
                                <option value="A" th:if="${!exercise.answer.equals('D')}">D</option>
                            </select>
                        </label>
                    </div>
                </div>
                <br>
                <div class="gtr-uniform row">
                    <div class="col-6-xsmall col-6">
                        <a class="button primary" onclick="submitExercise()">修改</a>
                        <a th:href="@{|/toAddChapter|}" class="button">添加新章节</a>
                        <a class="button" th:href="@{|/toManageExercise|}">取消</a>
                    </div>
                </div>
            </form>
        </section>

        <!-- two -->
        <section id="two" class="inner">

        </section>

        <!-- Contact -->
        <section id="contact">

        </section>

        <!-- Footer -->
        <footer id="footer">
            <div class="inner">
                <ul class="icons">
                    <li><a href="#" class="icon brands alt fa-github"><span class="label">GitHub</span></a></li>
                </ul>
                <ul class="copyright">
                    <li>&copy; xxx</li><li>制作: <a href="#">my</a></li>
                </ul>
            </div>
        </footer>
    </div>

    <!-- Scripts -->
    <script src="../../static/html5up-forty/assets/js/jquery.min.js"></script>
    <script src="../../static/html5up-forty/assets/js/jquery.scrolly.min.js"></script>
    <script src="../../static/html5up-forty/assets/js/jquery.scrollex.min.js"></script>
    <script src="../../static/html5up-forty/assets/js/browser.min.js"></script>
    <script src="../../static/html5up-forty/assets/js/breakpoints.min.js"></script>
    <script src="../../static/html5up-forty/assets/js/util.js"></script>
    <script src="../../static/html5up-forty/assets/js/main.js"></script>
    <script src="../../static/js/util.js"></script>
    <script src="../../static/js/manage_exercise_save.js"></script>
</div>
</body>
</html>